As technology advances, computer systems include greater numbers of processors, in the form of multiprocessor systems, e.g., via one or more multi-core processors that can execute multiple threads concurrently. Generally, before a thread accesses a shared resource, it may acquire a lock on the shared resource. In situations where the shared resource is a data structure stored in memory, all threads that are attempting to access the same resource may serialize the execution of their operations in light of mutual exclusivity provided by the locking mechanism. This may be detrimental to system performance and may cause program failures, e.g., due to deadlocks or other unwanted behavior.
The ever increasing number of cores and logical processors in a system enables more software threads to be executed. However, the increase in the number of software threads that may be executed simultaneously has created problems with synchronizing data shared among the software threads. One common solution to accessing shared data in multiple core or multiple logical processor systems uses locks to guarantee mutual exclusion across multiple accesses to shared data. However, the ever increasing ability to execute multiple software threads potentially results in false contention and a serialization of execution.
To reduce performance loss resulting from utilization of locking mechanisms, some computer systems may use transactional memory (TM). Transactional memory generally refers to a synchronization model that allows multiple threads to concurrently access a shared resource without utilizing a locking mechanism.
Often transactional execution may include speculatively executing groups of micro-operations, operations, or instructions. Current TM systems include hardware TM systems in which processor hardware is used to perform transactions, software TM systems in which transactions are implemented in software and hybrid TM systems in which both hardware and software can be used to execute a transaction. Typically, a hardware TM system can be most efficient, but if a transaction becomes too large, e.g., overflows a hardware memory, then the transaction is usually restarted. Here, the time taken to execute the transaction up to the overflow is potentially squandered.
Processors include various hardware and can also provide hardware for testing, debug and other operations. For example, various registers can be provided in a processor for performing processor checkpointing, exception reporting, branch recording and so forth. However, such performance monitoring hardware is generally not used in the context of transactional memory.